package com.designmodel.chainmodel;

/**
 * Created by
 * 测试类
 * @author touni
 * @date 2019/4/2
 * @time 10:52
 */
public class MainDemo {

    public static void main(String[] args) {
        //创建过滤责任处理对象
        Filter encodingFilter = new EncodingFilter();
        Filter tokenFilter = new TokenFilter();
        //创建责任链对象  越前面添加越快执行
        FilterChain filterChain = new FilterChain();
        filterChain.filterList.add(encodingFilter);
        filterChain.filterList.add(tokenFilter);

        //创建servlet对象
        Servlet concreteServlet = new ConcreteServlet();

        //关联责任链对象
        filterChain.setServlet(concreteServlet);

        //执行过滤
        filterChain.doFilter("","");







    }



}
